const state = {
    showAside: false,
    title: '卖座电影',
    city: ''
}

const getters = {
    showAside: state => state.showAside,
    title: state => state.title,
    city: state => state.city
}

// 对state的数据进行操作
const mutations = {
    updateTitle(state,payload) {
        state.title = payload;
    },
    updateCity(state,payload) {
        state.city = payload;
    },
    updateShowAside(state) {
        state.showAside = !state.showAside;
    }
}

// 提交mutation
const actions = {
	// 可以进行异步操作
    updateShowAside({
        commit
    }, payload) {
        commit('updateShowAside');
    }
}


export default {
	state,
	getters,
	mutations,
	actions
}
